package com.sctvcloud.bazhong.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.bazhong.R;
import com.sctvcloud.bazhong.beans.FSubscribe;
import com.sctvcloud.bazhong.ui.adapter.holder.MySubscribeHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/6/22 0022.
 */

public class MySubscribeAdapter extends BaseHolderAbsAdapter<FSubscribe, MySubscribeHolder> {
    public MySubscribeAdapter(Context context, List<FSubscribe> list) {
        super(context, list);

    }

    public void remove(int position) {
        data.remove(position);
        notifyDataSetChanged();
    }

    @Override
    public MySubscribeHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_my_subscribe, parent, false);
        MySubscribeHolder mySubscribeHolder = new MySubscribeHolder(context, view);
        mySubscribeHolder.setOnItemInternalClick(this);
        return mySubscribeHolder;
    }

    @Override
    public MySubscribeAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }
}
